joApps.WebViewer = {

	id: 'WebViewer',

	menubar: {	
		'WebViewer': {
			'About WebViewer': 'joApps.WebViewer.about();'
		},
		
		'File': {
			'Open File...': 'joApps.WebViewer.openFile();',
		},
		
		'View': {
			'Page Source': 'joApps.WebViewer.showSource();'
		},
	},
	
	start: function(){
		var win = joCore.UI.window({
			width: 500,
			height: 500,
			application: this.id,
		});
		
		win.addContent('<input type="text" style="display:block;width:100%;" class="webviewer-browser-locationbar" />');
		win.addContent('<iframe class="webviewer-browser-content" style="width:100%;height:100%;border:black 1px solid;"></iframe>');
		
		joEvent.addEvent($C('webviewer-browser-locationbar'), 'change', function(event){
			var file = joFileManager.getFile(event.target.value);
			
			joCore.logger.log(file.getAttribute('data'));
			
			
			$C('webviewer-browser-content').contentDocument.write(file.getAttribute('data').replace('&lt;', '<').replace('&gt;', '>'));
		}, false, this);
	},

	openFile: function(){
	
	
	},
	
	
	showSource: function(){
		var win = joAppManager.getFrontWindow(this.id);
		
		joCore.UI.dialog({
			width: 500,
			height: 300,
			message: 'Not Supported'
		});
	},

};

joApps.WebViewer.window = function(param){
	this.param = param;
	
	this.init();
	this.init_self();
}
joApps.WebViewer.window.prototype = {




};
joApps.WebViewer.window.prototype.__proto__ = joWindow.prototype;